<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var arr=[undefined,'23year',19,"097",1,'hello',null,1]
    var sum=0
    function getSum(arr){
        var brr=[]
        // (!isNaN(arr[i])&&arr[i])
        for(i=0;i<arr.length;i++){
            if(typeof(arr[i])=='number'){
                if(brr.indexOf(arr[i])==-1){
                    brr.push(arr[i])
                    sum+=arr[i]
                }
            }
        }
        return sum
    }
    console.log(getSum(arr))
    
</script>